<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" name="viewport" />
    <meta http-equiv="content-script-type" content="text/javascript">
    <meta name="format-detection" content="telephone=no" />
    <!-- uc强制竖屏 -->
    <meta name="screen-orientation" content="portrait">
    <!-- QQ强制竖屏 -->
    <meta name="x5-orientation" content="portrait">
            <link rel="shortcut icon" href="/favicon.ico">
            <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
        <meta http-equiv="Pragma" content="no-cache" />
        <meta http-equiv="Expires" content="0" />
    <title>退换货</title>
    <link rel="stylesheet"href="statics/mobile/css/style.css?v=2017061659333656423412">
    <link rel="stylesheet"href="statics/mobile/css/SpsBtn.css?v=2017061659333656423412">

    <link rel="stylesheet"href="statics/mobile/css/Order/detail.css?v=2017061659333656423412">
    <link rel="stylesheet"href="statics/mobile/css/Order/orderlist.css?v=2017061659333656423412">
    <style>
        body{
            -webkit-user-select: text;
        }
        .active{
           background-color: #000;
           opacity: 0.7;
           color:#fff;
        }
    </style>

    <script type="text/javascript">
        var site_root='<?php echo API_STORE;?>';
    </script>

</head>

<body style="">
<div class="membersbox pad50">


    <div class="orderDetailtit clearfix">
        <div class="info-item fl">
            <p>
                <span>订单：</span>
                <span class="j-order_no"><?php echo $order['order_sn'];?>(<strong style="color:#ff0000;"><?php echo $GLOBALS['order_status'][$order['order_status']];?></strong>)</span>
            </p>
            <p>
              <span>时间：</span><span class="j-create_time"><?php echo date('Y-m-d H:i:s',$order['updatetime']);?></span>
            </p>
        </div>
    </div>
    <div class="orderDetail">
        <ul class="goods">
          <?php foreach($goods as $k=>$v){?>
            <li class="clearfix">
                    <div class="goods-img fl">
                    <img src="<?php echo $v['goods_thumb'];?>" alt="<?php echo $v['goods_name'];?>">
                    </div>
                    <div class="goods-info">
                        <p class="title"><?php echo $v['goods_name'];?></p>
                        <p class="sku">
                            <span>数量：&times;<?php echo $v['num'];?></span>
                            <span> <?php echo $v['sku_name'];?></span>
                            <span class="price">&yen;<?php echo $v['current_price'];?></span>
                        </p>
                        <p style="text-align:right;"><input type="checkbox" name="goods_id" checked value="<?php echo $v['goods_id'];?>"/></p>
                    </div>
              </li>
          <?php }?>
        </ul>
        <!-- 虚拟帐号信息 -->

        <ul class="money">

            <li class="clearfix">
                <span class="fl">退换原因</span>
                <span class="fr">
                  <select id="refund_reason" style="height:32px;background-color:#fff;border:0px;">
                    <?php foreach($GLOBALS['reason'] as $k=>$v){?>
                    <option value="<?php echo $k;?>"><?php echo $v;?></option>
                    <?php }?>
                  </select>
                </span>
            </li>

        </ul>
		<ul class="money">
           <li class="clearfix">
                <span class="fl">退款金额：</span>
                <span class="fr">￥<input type="text" id="refund_amount" value="0" style="border:1px solid #ccc;height:22px;line-height:22px;width:45px;text-align:center;"/></span>
            </li>

        </ul>
        <ul class="money">
            <li>备注说明(选填)：</li>
            <li class="clearfix" style="font-size:0.8rem;">
                <textarea id="refund_content" style="width:100%;height:70px;border:0px;" placeholder="若由于个人原因退货，退货邮费由买家承担。若商家原因退货，情况属实，退货邮费由商家承担，请与商家协商并提供问题凭证。"></textarea>
            </li>
            <li>
              <div id="refund_box" style="display:flex">
                <div style="border:1px dashed #666;width:60px;height:60px;font-size:3rem;font-weight:400;text-align:center;line-height:60px;" onclick="upload('refund');">+</div>
              </div>
              <p>最多能传三张图，单击图片可删除</p>
            </li>
        </ul>

    <section class="actions">
  		<a href="javascript:;"  class="mbtn btn-danger btn-big" style="background-color:rgb(255, 83, 2);" id="submit">提交</a>
    </section>
    </div>
    <?php include VIEWS_PATH."bottom.php";?>
</div>
<?php include VIEWS_PATH."footer.php";?>
<div id="tempform" style="display:none;"></div>
<iframe id="tempframe" name="tempframe" style="display:none;"></iframe>
<script>
var id='<?php echo $id;?>';
var site_root='<?php echo API_ROOT;?>';
function upload(field){
  if($("#refund_box").children('img').length>2){
    alert('最多能传三张图，单击图片可删除');
    return false;
  }
	str='<form id="'+field+'form" target="tempframe" method="post" action="'+site_root+'tool/upload.php" enctype="multipart/form-data"><input id="'+field+'" name="'+field+'" style="display: none" type="file" value=""></form>';
	$("#tempform").html(str);
	$("#"+field).click();
}
$("#tempform").on("change","input[type='file']",function(){
	$(this).parent().submit();
});
function parseFile(file){
	$("#"+file.key+"_box").prepend('<img style="width:62px;height:62px;" src="'+file.name+'">');
}
$("#refund_box").on('click','img',function(){
  if(confirm('确定删除？')){
    $(this).remove();
  }

});
$("#submit").click(function(){
  data={commit:1};
  data.reason=$("#refund_reason").val();
  data.amount=$("#refund_amount").val();
  data.content=$("#refund_content").val();
  imglist=[];
  $("#refund_box").find('img').each(function(){
    imglist.push($(this).attr('src'));
  });
  data.imglist=imglist.join(',');
  data.oid=id;
  goods_ids=[];
  $("input[name='goods_id']:checked").each(function(){
    goods_ids.push($(this).val());
  });
  data.goods_id=goods_ids.join(',');
  $.post('?con=order&act=refund',data,function(result){
    if(result.status=='1'){
      window.location.href='?con=order';
    }
  },'json');
});
</script>
</body>
</html>
<!-- 20170105 -->
